package cn.rtangyy.seckilling.service;

import cn.rtangyy.seckilling.entity.SeckillGoods;
import cn.rtangyy.seckilling.entity.SeckillOrder;
import cn.rtangyy.seckilling.entity.User;

public interface SeckillOrderService {

    /**
     * 根据用户 Id 与订单 Id 判断重复抢购
     * @param userId
     * @param goodsId
     * @return
     */
    boolean orderIsExist(Long userId, Long goodsId);

    /**
     * 插入秒杀订单
     * @param seckillOrder
     */
    void insertSecOrder(SeckillOrder seckillOrder);


    /**
     * 获取秒杀结果
     * @param user
     * @param goodsId
     * @return
     */
    Long getResult(User user, Long goodsId);
}
